import request from '@/util/request'
import { dealOpts, FIRM } from './../api_type'

// employess
const firmGetStaffs = (params, opts) => {
  return request.get(dealOpts(FIRM + '/getStaffs', opts), params)
}

const firmGetStaffInfo = (params, opts) => {
  return request.get(dealOpts(FIRM + '/getStaffInfo', opts), params)
}

const firmCreateStaff = (params, opts) => {
  return request.get(dealOpts(FIRM + '/createStaff', opts), params)
}

const firmUpdateStaff = (params, opts) => {
  return request.post(dealOpts(FIRM + '/modifyStaff', opts), params)
}

const firmDeleteStaff = (params, opts) => {
  return request.get(dealOpts(FIRM + '/deleteStaff', opts), params)
}

const firmGetDepts = (params, opts) => {
  return request.get(dealOpts(FIRM + '/getDepartments', opts), params)
}

const firmAddDepts = (params, opts) => {
  return request.get(dealOpts(FIRM + '/addDeptStaff', opts), params)
}

const firmGetStaffRoles = (params, opts) => {
  return request.get(dealOpts(FIRM + '/getStaffRoles', opts), params)
}

const firmGetStaffSubordinates = (params, opts) => {
  return request.get(dealOpts(FIRM + '/getStaffSubordinates', opts), params)
}

const firmAddUnderStaff = (params, opts) => {
  return request.get(dealOpts(FIRM + '/addUnderStaff', opts), params)
}

const firmDeleteUnderStaff = (params, opts) => {
  return request.get(dealOpts(FIRM + '/deleteUnderStaff', opts), params)
}

export default {
  firmGetStaffs,
  firmGetStaffInfo,
  firmCreateStaff,
  firmUpdateStaff,
  firmDeleteStaff,
  firmGetDepts,
  firmAddDepts,
  firmGetStaffRoles,
  firmGetStaffSubordinates,
  firmAddUnderStaff,
  firmDeleteUnderStaff
}
